fib_table = {}
def fib_num(n):
    print("斐波那契函数调用")
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        fib_table[n] = fib_num(n-1) + fib_num(n-2)
        return fib_table[n]
    
n = int(input("请输入斐波那契数列的长度: \n"))
print("斐波那契数列的第", n , "项是", fib_num(n))
print("斐波那契数列是", fib_num(n))